<?php
/**
 * Create by Phpstorm
 * User: Peco
 * Date: 2019/12/4
 * Time: 16:33
 */


namespace App\Http\Requests\Order;


use App\Http\Requests\ApiRequest;

class UpdateReceiverRequest extends ApiRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * 传递参数 验证规则
     *
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'consignee' => 'required',
            'orderId' => 'required|integer',
            'phone' => 'required',
            'receiverAddress' => 'required',
            'receiverCity' => 'required',
            'receiverDetailAddress' => 'required',
            'receiverProvince' => 'required',
            'zip' => 'required',
        ];
    }

    /**
     * 获取已定义验证规则的错误消息。
     *
     * @return array
     */
    public function messages()
    {
        return [
            'shipNo.required' => '缺少物流单号',
        ];
    }
}
